﻿using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Logging;

namespace Devonline.AspNetCore;

/// <summary>
/// Provides functionality for managing organizations, including data operations and handling attachments.
/// </summary>
/// <remarks>This service is designed to work with a specific database context type and supports distributed
/// caching, HTTP context access, file operations, and configurable HTTP settings. It extends the capabilities of <see
/// cref="DataWithAttachmentService{TDbContext, TEntity}"/> to include organization-specific operations.</remarks>
/// <typeparam name="TDbContext"></typeparam>
/// <param name="logger"></param>
/// <param name="context"></param>
/// <param name="cache"></param>
/// <param name="httpContextAccessor"></param>
/// <param name="fileService"></param>
/// <param name="httpSetting"></param>
public class OrganizationService<TDbContext>(
    ILogger<OrganizationService<TDbContext>> logger,
    TDbContext context,
    IDistributedCache cache,
    IHttpContextAccessor httpContextAccessor,
    IFileService fileService,
    CredentialService<TDbContext> credentialService,
    HttpSetting httpSetting) :
    DataWithAttachmentService<TDbContext, Organization>(logger, context, cache, httpContextAccessor, fileService, httpSetting),
    IDataWithAttachmentService<TDbContext, Organization>
    where TDbContext : DbContext
{
    protected readonly CredentialService<TDbContext> _credentialService = credentialService;
}